<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="体系架构," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="ARM获得当前PC需要PC=PC+8？1、抛出问题为何ARM9和ARM7一样？一个是五级流水线结构，另外一个是三级流水线结构，怎么也是PC=PC+8？ 
ARM9五级流水线 VS ARM7三级流水线
对应的映射关系
2、解析问题先列出ARM9的五级流水线的示例：以uboot中的start.S的最开始的汇编代码为例来进行解释：由反汇编可得：
00000000 &amp;lt;_start&amp;gt;:
   0">
<meta property="og:type" content="article">
<meta property="og:title" content="ARM获得当前PC需要PC=PC+8？">
<meta property="og:url" content="http://ideask.cf/2017/01/26/Pipeline-architecture/index.html">
<meta property="og:site_name" content="Jason Lin">
<meta property="og:description" content="ARM获得当前PC需要PC=PC+8？1、抛出问题为何ARM9和ARM7一样？一个是五级流水线结构，另外一个是三级流水线结构，怎么也是PC=PC+8？ 
ARM9五级流水线 VS ARM7三级流水线
对应的映射关系
2、解析问题先列出ARM9的五级流水线的示例：以uboot中的start.S的最开始的汇编代码为例来进行解释：由反汇编可得：
00000000 &amp;lt;_start&amp;gt;:
   0">
<meta property="og:image" content="http://my.csdn.net/uploads/201207/08/1341755975_5410.png">
<meta property="og:image" content="http://my.csdn.net/uploads/201207/08/1341755957_7798.png">
<meta property="og:image" content="http://my.csdn.net/uploads/201207/08/1341755941_1321.jpg">
<meta property="og:updated_time" content="2017-01-26T02:40:28.426Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="ARM获得当前PC需要PC=PC+8？">
<meta name="twitter:description" content="ARM获得当前PC需要PC=PC+8？1、抛出问题为何ARM9和ARM7一样？一个是五级流水线结构，另外一个是三级流水线结构，怎么也是PC=PC+8？ 
ARM9五级流水线 VS ARM7三级流水线
对应的映射关系
2、解析问题先列出ARM9的五级流水线的示例：以uboot中的start.S的最开始的汇编代码为例来进行解释：由反汇编可得：
00000000 &amp;lt;_start&amp;gt;:
   0">
<meta name="twitter:image" content="http://my.csdn.net/uploads/201207/08/1341755975_5410.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://ideask.cf/2017/01/26/Pipeline-architecture/"/>





  <title> ARM获得当前PC需要PC=PC+8？ | Jason Lin </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Jason Lin</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
    
      <p class="site-subtitle">Jason's Blog</p>
    
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>


    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://ideask.cf/2017/01/26/Pipeline-architecture/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Jason Lin">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Jason Lin">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Jason Lin" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                ARM获得当前PC需要PC=PC+8？
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-26T10:23:24+08:00">
                2017-01-26
              </time>
			  </span>
			
			<span>
    
			<span>更新于</span>
			<time>
			2017-01-26
			10:23:24
			</time>
			</span>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/ARM体系架构/" itemprop="url" rel="index">
                    <span itemprop="name">ARM体系架构</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/01/26/Pipeline-architecture/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2017/01/26/Pipeline-architecture/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="ARM获得当前PC需要PC-PC-8？"><a href="#ARM获得当前PC需要PC-PC-8？" class="headerlink" title="ARM获得当前PC需要PC=PC+8？"></a>ARM获得当前PC需要PC=PC+8？</h1><h2 id="1、抛出问题"><a href="#1、抛出问题" class="headerlink" title="1、抛出问题"></a>1、抛出问题</h2><pre><code>为何ARM9和ARM7一样？一个是五级流水线结构，另外一个是三级流水线结构，怎么也是PC=PC+8？ 
</code></pre><h3 id="ARM9五级流水线-VS-ARM7三级流水线"><a href="#ARM9五级流水线-VS-ARM7三级流水线" class="headerlink" title="ARM9五级流水线 VS ARM7三级流水线"></a>ARM9五级流水线 VS ARM7三级流水线</h3><p><img src="http://my.csdn.net/uploads/201207/08/1341755975_5410.png" alt="这里写图片描述"></p>
<h3 id="对应的映射关系"><a href="#对应的映射关系" class="headerlink" title="对应的映射关系"></a>对应的映射关系</h3><p><img src="http://my.csdn.net/uploads/201207/08/1341755957_7798.png" alt="这里写图片描述"></p>
<h2 id="2、解析问题"><a href="#2、解析问题" class="headerlink" title="2、解析问题"></a>2、解析问题</h2><h3 id="先列出ARM9的五级流水线的示例："><a href="#先列出ARM9的五级流水线的示例：" class="headerlink" title="先列出ARM9的五级流水线的示例："></a>先列出ARM9的五级流水线的示例：</h3><p><img src="http://my.csdn.net/uploads/201207/08/1341755941_1321.jpg" alt="这里写图片描述"><br>以uboot中的start.S的最开始的汇编代码为例来进行解释：<br>由反汇编可得：</p>
<pre><code class="bash">00000000 &lt;_start&gt;:
   0:   ea000014   b   58 &lt;reset&gt;
   4:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 20 &lt;_undefined_instruction&gt;</span>
   8:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 24 &lt;_software_interrupt&gt;</span>
   c:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 28 &lt;_prefetch_abort&gt;</span>
  10:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 2c &lt;_data_abort&gt;</span>
  14:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 30 &lt;_not_used&gt;</span>
  18:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 34 &lt;_irq&gt;</span>
  1c:   e59ff014   ldr pc, [pc, <span class="comment">#20] ; 38 &lt;_fiq&gt;</span>

00000020 &lt;_undefined_instruction&gt;:
  20:   00000120   .word  0x00000120
</code></pre>
<p>下面对每一个指令周期，CPU做了哪些事情，分别详细进行阐述：<br>在看下面具体解释之前，有一句话要牢记，那就是：</p>
<pre><code class="bash">PC不是指向你正在运行的指令，而是
PC始终指向你要取的指令的地址。
</code></pre>
<p>认识清楚了这个前提，后面的举例讲解，就容易懂了。<br>指令周期Cycle1<br>（1）取指：<br>PC总是指向将要读取的指令的地址（即我们常说的，指向下一条指令的地址），而当前PC=4，<br>所以去取物理地址为4对对应的指令“ldr pc, [pc, #20]”，其对应二进制代码为e59ff014。<br>此处取指完之后，自动更新PC的值，即PC=PC+4（单个指令占4字节，所以加4）=4+4=8<br>指令周期Cycle2<br>（1）译指：翻译指令e59ff014；<br>（2）同时再去取指：<br>PC总是指向将要读取的指令的地址（即我们常说的，指向下一条指令的地址），而当前PC=8，<br>所以去物理地址为8所对应的指令“ldr pc, [pc, #20]” 其对应二进制代码为e59ff014。<br>此处取指完之后，自动更新PC的值，即PC=PC+4=8+4=12=0xc<br>指令周期Cycle3<br>（1）执行（指令）：执行“e59ff014”，即“ldr pc,[pc, #20]”所对表达的含义，即<br>PC<br>= PC + 20<br>= 12 + 20<br>= 32<br>= 0x20<br>此处，只是计算出待会要赋值给PC的值是0x20，这个0x20还只是放在执行单元中内部的缓冲中。<br>（2）译指：翻译e59ff014。<br>（3）取指：<br>此步骤由于是和上面（1）中的执行同步做的，所以，未受到影响，继续取指，而取指的那一时刻，PC为上一Cycle<br>更新后的值，即PC=0xc，所以是去取物理地址为0xc所对应的指令” ldr pc, [pc, #20]”，对应二进制为e59ff014。<br>其实，分析到这里，大家就可以看出：<br>在Cycle3的时候，PC的值，刚好已经在Cycle1和Cycle2，分别加了4，所以Cycle3的时候，PC=PC+8，而同样道理<br>，对于任何一条指令的，都是在Cycle3，指令的Execute执行阶段，如果用到PC的值，那么PC那一时刻，就是<br>PC=PC+8。<br>所以，此处虽然是五级流水线，但是却不是PC=PC+16，而是PC=PC+8。<br>进一步地，我们发现，其实PC=PC+N的N，是和指令的执行阶段所处于流水线的深度有关，即此处指令的执行<br>Execute阶段，是五级流水线中的第三个，而这个第三阶段的Execute和指令的第一个阶段的Fetch取指，相差的<br>值是 3 -1 =2，即两个CPU的Cycle，而每个Cycle都会导致PC=+PC+4，所以，指令到了Execute阶段，才会发现<br>，此时PC已经变成PC=PC+8了。<br>回过头来反观ARM7的三级流水线，也是同样的道理，指令的Execute执行阶段，是处于指令的第三个阶段，<br>同理，在指令计算数据的时候，如果用到PC，就会发现此时PC=PC+8。<br>同理，假如ARM9的五级流水线，把指令的Execute执行阶段，设计在了第四个阶段，那么就是<br>PC=PC+（第4阶段-1）*4个字节 = PC= PC+12了。</p>
<h2 id="3、总结"><a href="#3、总结" class="headerlink" title="3、总结"></a>3、总结</h2><p>ARM7的三级流水线，PC=PC+8，<br>ARM9的五级流水线，也是PC=PC+8，<br>根本的原因是，两者的流水线设计中，指令的Execute执行阶段，都是处于流水线的第三级，<br>所以使得PC=PC+8。<br>类似地，可以推导出：<br>假设，Execute阶段处于流水线中的第E阶段，每条指令是T个字节，那么<br>PC<br>= PC + N<em>T<br>= PC + (E - 1) </em> T<br>此处ARM7和ARM9：<br>Execute阶段都是第3阶段-&gt; E=3<br>每条指令是4个字节-&gt; T=4<br>所以：<br>PC<br>=PC + N<em> T<br>=PC + (3 -1 ) </em> 4<br>= PC + 8</p>
<h2 id="关于直接改变PC的值，会导致流水线清空的解释"><a href="#关于直接改变PC的值，会导致流水线清空的解释" class="headerlink" title="关于直接改变PC的值，会导致流水线清空的解释"></a>关于直接改变PC的值，会导致流水线清空的解释</h2><p>   把PC的值直接赋值为0x20。而PC值更改，直接导致流水线的清空，即导致下一个cycle中的，对应的流水线中的<br>其他几个步骤，包括接下来的同一个Cycle中的取指的工作被取消。在PC跳转到0x20的位置之后，流水线重新计算<br>，重新一步步地按照流水线的逻辑，去一点点执行。当然要保证当前指令的执行完成，即执行之后，<br>还有两个cycle，分别做的Memory和Write，会继续执行完成。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>如果文章对您有用请随意打赏，谢谢支持！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/images/w.png" alt="Jason Lin WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/images/z.jpg" alt="Jason Lin Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/体系架构/" rel="tag"># 体系架构</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/01/23/embedded-system-learning/" rel="next" title="嵌入式linux系统开发学习路径">
                <i class="fa fa-chevron-left"></i> 嵌入式linux系统开发学习路径
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/02/01/arm-asm/" rel="prev" title="ARM指令和指令系统">
                ARM指令和指令系统 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2017/01/26/Pipeline-architecture/"
     data-title="ARM获得当前PC需要PC=PC+8？"
     data-content=""
     data-url="http://ideask.cf/2017/01/26/Pipeline-architecture/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>

          
          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2017/01/26/Pipeline-architecture/"
           data-title="ARM获得当前PC需要PC=PC+8？" data-url="http://ideask.cf/2017/01/26/Pipeline-architecture/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="Jason Lin" />
          <p class="site-author-name" itemprop="name">Jason Lin</p>
          <p class="site-description motion-element" itemprop="description">embedded system engineer</p>
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">15</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">9</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">9</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/ideask" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/ideask" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/ideask" target="_blank" title="微博">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  微博
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://douban.com/people/ideask" target="_blank" title="豆瓣">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  豆瓣
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/ideask" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友情链接
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jyu.edu.cn/" title="嘉应大学" target="_blank">嘉应大学</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#ARM获得当前PC需要PC-PC-8？"><span class="nav-number">1.</span> <span class="nav-text">ARM获得当前PC需要PC=PC+8？</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1、抛出问题"><span class="nav-number">1.1.</span> <span class="nav-text">1、抛出问题</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#ARM9五级流水线-VS-ARM7三级流水线"><span class="nav-number">1.1.1.</span> <span class="nav-text">ARM9五级流水线 VS ARM7三级流水线</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#对应的映射关系"><span class="nav-number">1.1.2.</span> <span class="nav-text">对应的映射关系</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2、解析问题"><span class="nav-number">1.2.</span> <span class="nav-text">2、解析问题</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#先列出ARM9的五级流水线的示例："><span class="nav-number">1.2.1.</span> <span class="nav-text">先列出ARM9的五级流水线的示例：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3、总结"><span class="nav-number">1.3.</span> <span class="nav-text">3、总结</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#关于直接改变PC的值，会导致流水线清空的解释"><span class="nav-number">1.4.</span> <span class="nav-text">关于直接改变PC的值，会导致流水线清空的解释</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Jason Lin</span>
</div>



        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"ideask"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  












  
  
  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length == 0) {
      search_path = "search.xml";
    }
    var path = "/" + search_path;
    // monitor main search box;

    function proceedsearch() {
      $("body").append('<div class="popoverlay">').css('overflow', 'hidden');
      $('.popup').toggle();
    }
    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';
      $.ajax({
        url: path,
        dataType: "xml",
        async: true,
        success: function( xmlResponse ) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = $( "entry", xmlResponse ).map(function() {
            return {
              title: $( "title", this ).text(),
              content: $("content",this).text(),
              url: $( "url" , this).text()
            };
          }).get();
          var $input = document.getElementById(search_id);
          var $resultContent = document.getElementById(content_id);
          $input.addEventListener('input', function(){
            var matchcounts = 0;
            var str='<ul class=\"search-result-list\">';
            var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
            $resultContent.innerHTML = "";
            if (this.value.trim().length > 1) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var content_index = [];
                var data_title = data.title.trim().toLowerCase();
                var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
                var data_url = decodeURIComponent(data.url);
                var index_title = -1;
                var index_content = -1;
                var first_occur = -1;
                // only match artiles with not empty titles and contents
                if(data_title != '') {
                  keywords.forEach(function(keyword, i) {
                    index_title = data_title.indexOf(keyword);
                    index_content = data_content.indexOf(keyword);
                    if( index_title >= 0 || index_content >= 0 ){
                      isMatch = true;
                      if (i == 0) {
                        first_occur = index_content;
                      }
                    }

                  });
                }
                // show search results
                if (isMatch) {
                  matchcounts += 1;
                  str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
                  var content = data.content.trim().replace(/<[^>]+>/g,"");
                  if (first_occur >= 0) {
                    // cut out 100 characters
                    var start = first_occur - 20;
                    var end = first_occur + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if(start == 0){
                      end = 50;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    var match_content = content.substring(start, end);
                    // highlight all keywords
                    keywords.forEach(function(keyword){
                      var regS = new RegExp(keyword, "gi");
                      match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
                    });

                    str += "<p class=\"search-result\">" + match_content +"...</p>"
                  }
                  str += "</li>";
                }
              })};
            str += "</ul>";
            if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
            if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
            $resultContent.innerHTML = str;
          });
          proceedsearch();
        }
      });}

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched == false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(function(e){
      $('.popup').hide();
      $(".popoverlay").remove();
      $('body').css('overflow', '');
    });
    $('.popup').click(function(e){
      e.stopPropagation();
    });
  </script>


  

  
  

  


</body>
</html>
